import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/page/Login'
import Index from '~/page/Index'

Vue.use(Router);

export default new Router({
  // mode: 'history',
  routes: [
    {
      path:'/',
      component: Login
    },
    {
      path:'/index',
      component: Index,
      name:'首页'
    },
    {
      path:'/manager',
      component: resolve => require(['@/page/manager/Index'],resolve),
      name:'管理',
      children:[
        {
          path: 'auditlist',
          component: resolve => require(['@/page/manager/auditList'],resolve),
          name:'审计日志管理'
        },
        {
          path: 'keywordlist',
          component: resolve => require(['@/page/manager/keyWordList'],resolve),
          name:'关键词过滤'
        },
        {
          path: 'accessLogList',
          component: resolve => require(['@/page/manager/accessLogList'],resolve),
          name:'访问日志管理'
        }
      ]
    }
  ],
  scrollBehavior (to, from, savedPosition) {
    return {x:0,y:0}
    // return 期望滚动到哪个的位置
  }
})
